@echo off

SET CFLG=-D___SYS_I486 -D___OS_WIN
SET GFLG=-D___GUI
SET IFLG=-I. -Ilib

IF "%1" EQU "-g" (
  SET CFLG=%CFLG% %GFLG%
  shift
)
IF "%1" EQU "-x" (
  SET CFLG=%CFLG% -D___DLLIMP
  shift
)
IF "%1" EQU "-ropt" (
  SET CFLG=%CFLG% -D___ROPT
  shift
)
IF "%1" EQU "" (
  echo "Args: [-g] [-x] [-ropt] <name>"
  exit
)
SET NAM=%1
shift

echo CFLG=%CFLG%
gcc -s -O2 -Wall -c %CFLG% %IFLG% %NAM%.c
